
import model.entities.Category;
import model.entities.User;

import org.hibernate.Session;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Le Chau
 */
public class demohibernate {
public static void main(String[] args) {
    Session se = utils.NewHibernateUtil.getSessionFactory().getCurrentSession();
    User a = new User();
    a.setEmail("chau2");
    a.setPassword("hdeuhdeu");
    Category ca = new Category();
    ca.setName("new Ca");
    ca.setDescription("description");
    se.getTransaction().begin();
    se.save(a);
    se.flush();
    se.getTransaction().commit();
}
}
